
from flask import Flask
from wsgiref.simple_server import make_server

app = Flask(__name__)

@app.route('/') # http://127.0.0.1:5000
def root_func():
    print("被访问了")
    return 'hello world'

@app.route('/login') # http://127.0.0.1:5000/login
def login_func():
    print("登录被访问了")
    return '----login'

if  __name__ == '__main__':
    server = make_server('127.0.0.1',5000,app) #外部访问的url,端口
    server.serve_forever()
    app.run()

